 /**
  ******************************************************************************
  * @file    display.h
  * @author  N-K-J
  * @version V0.0.1
  * @date    2012/12/11
  * @brief   display.h
  ******************************************************************************
 **/
#ifndef _DISPLAY_H
#define _DISPLAY_H

#include "stdio.h"
#include "stdint.h"
#include "stdarg.h"
#include "math.h"
#include "mSCConfig.h"

#if DISPLAYCB 

typedef enum _derrorcode
{
	D_SUCCESS = 0,	//成功
	D_FAIL,			//失败
}eDerrorcode;

typedef enum _fontLib
{
	FONT_NONE = 0,	        //无
	FONT_ASCII_3X5,			//3x5 ascii
	FONT_ASCII_5X7,			//5x7 ascii
	FONT_ASCII_8X8,			//8x8 ascii
	FONT_ASCII_8X16,		//8x16 ascii
	FONT_HANZI_16X16,		//16x16 汉字

}eFontLib;


extern void displayInit(void);
extern eDerrorcode displayRegister(uint32_t *id,void *init,void *setXYZ,void *setConversely,void *setFrontRGB,void *setBackRGB,void *clear,void *putChar,void *setPoint,void *refresh);
extern eDerrorcode displayDelete(uint32_t *id);
extern eDerrorcode displaySelect(uint32_t id);
extern void displayClear(void);
extern void displayByXYZ(int x,int y,int z,const char *format, ...);
extern void displayByXYZConversely(int x,int y,int z,const char *format, ...);
extern void display(const char *format, ...);
extern int mscPrintf(const char *format, ...);
extern int mscSprintf(char *out, const char *format, ...);

//#if GRAPHICDISPLAYEN
extern void displayRefresh(void);
extern void displaySetXYZ(uint16_t x,uint16_t y,uint16_t z);
extern void displaySetFontSize(uint16_t s);
extern void displaySelectFontLib(uint8_t asciilib,uint8_t hanzilib);
extern void displaySetColor(uint32_t f,uint32_t b);
extern void displaySetConversely(uint8_t c);
extern void displayPutChar(int ch);
extern void displayLine(int16_t sx,int16_t sy,int16_t ex,int16_t ey,uint16_t lw,uint32_t rgb);
extern void displayRectangle(uint16_t x,uint16_t y,uint16_t len,uint16_t wid,uint16_t linew,uint32_t rgb);
extern void displayTriangle(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2,uint16_t x3,uint16_t y3,uint16_t linew,uint32_t rgb);
extern void displayEllipse(int16_t xc,int16_t yc,uint16_t a,uint16_t b,uint16_t lw,uint32_t rgb);
extern void displayCircular(int16_t x,int16_t y,uint16_t r,uint16_t lw,uint32_t rgb);
extern void displayPicture(int16_t x,int16_t y,uint16_t w,uint16_t h,uint8_t depth,void *rgb);
extern void displayGB2312_16x16(int16_t x,int16_t y,uint8_t n,char *hz,uint32_t rgb);
extern void displayASCII_3x5(int16_t x,int16_t y,uint8_t n,char ch,uint32_t rgb);
extern void displayASCII_5x7(int16_t x,int16_t y,uint8_t n,char ch,uint32_t rgb);
extern void displayASCII_8x8(int16_t x,int16_t y,uint8_t n,char ch,uint32_t rgb);
extern void displayASCII_8x16(int16_t x,int16_t y,uint8_t n,char ch,uint32_t rgb);
extern void displayProgressBar(int16_t x,int16_t y,uint16_t l,uint16_t w,uint16_t s,uint16_t e,uint16_t current,uint8_t style,uint32_t rgb);
extern void displayFrameMove(uint16_t l,uint16_t h,int32_t *line,int32_t *column,int16_t d,uint8_t style);
//#endif

#endif

#endif
